﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Jumpton.SFA.Server.BusinessRule.InStoreDataMeasures;
using Jumpton.SFA.Server.Entity;

/// <summary>
/// 常规指标维护
/// Update By:Allen Jiang
/// Update Time:2008-12-26
/// Description:
///     修改常规指标维护在一个页面。
/// </summary>
public partial class InStoreDataMeasures_MeasuresDetail_Select_List : PageBase
{
    private const string MeasuresDetail_List = "MeasuresDetail_Select_List.aspx";

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GetMeasuresDetailBind();
        }
    }

    /// <summary>
    /// 数据绑定
    /// </summary>
    public void GetMeasuresDetailBind()
    {
        string where = "";

        if (ddl_active.SelectedValue != "")
        {
            where += " AND ACTIVE="+ddl_active.SelectedValue;
        }

        if (txt_key.Text != "")
        {
            where += " AND ( NAME LIKE '%"+txt_key.Text+"%' OR CODE LIKE '%"+txt_key.Text+"%') ";
        }


       GridPager1.DataSource = new MeasuresDetailManager().GetMeasuresDetailTable(MyStateManager.DomainID,where);
       GridPager1.GridView = GridView1;
       GridPager1.BindData();
       GridPager1.Visible = GridView1.Rows.Count > 0;
       
    }


    protected void btnSearch_Click(object sender, EventArgs e)
    {
        GetMeasuresDetailBind();
    }
}
